//
//  Track.mm
//  MantuPlay
//
//  Created by Markus Sintonen on 22.3.2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "Track.h"
#import "NSStringExtensions.h"
#import "NSArrayExtensions.h"
#import "ID3TagReader.h"
#import <string>

@implementation Track

@synthesize album, artist, genre, trackNumber, albumArtData, partOfSet, trackFilepath;
/*
-(id)initWithFile:(const char*)file {
	self = [super init];
	if (self != nil) {
		ID3TagReader *tag = [[ID3TagReader alloc] initWithFile:file framesToRead:allFrameTypes];
		self.title = tag.title;
		self.artist = tag.artist;
		self.album = tag.album;
		self.genre = tag.genre;
		self.trackNumber = tag.trackNumber;
		self.albumArtData = tag.albumArtData;
		self.partOfSet = tag.partOfSet;
		self.filePathRelativeToScanDir = [NSString stringWithUTF8String:file];
		[tag release];
		
		if([title length] <= 0)
			self.title = [[[NSString stringWithUTF8String:file] lastPathComponent] stringByDeletingPathExtension];
	}
	return self;
}
*/
-(NSString*)getCompleteFilePath {
	return [trackFilepath getCompleteFilePath];
}

- (void)dealloc {
	[artist release];
	[album release];
	[genre release];
	[trackNumber release];
	[albumArtData release];
	[trackFilepath release];
	[super dealloc];
}
@end
